package cn.hchaojie.web.day04;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;

// 用来做初始化操作的servlet，
// 在（web容器）tomcat启动的时候，servlet就会被创建
public class InitializeServlet extends HttpServlet {
	@Override
	public void init() throws ServletException {
		System.out.println("servlet初始化完成。。。");
		
		// 做初始化操作
		
		String logFile = getServletContext().getInitParameter("logFile");
		System.out.println(logFile);
		
		getServletContext().setAttribute("logFile", logFile);
	}
}
